; -- 安装程序核心配置 --
[Setup]
AppName=市场情绪监控
AppVersion=1.0.0
AppPublisher=YourCompany
DefaultDirName={autopf}\StockMonitor    ; 默认安装路径
DefaultGroupName=股票监控               ; 开始菜单目录名
UninstallDisplayIcon={app}\StockMonitor.exe
OutputBaseFilename=StockMonitor_Setup  ; 生成的安装包名称
Compression=lzma2                      ; 压缩方式
SolidCompression=yes
SetupIconFile=assets\installer.ico     ; 安装程序图标
PrivilegesRequired=admin               ; 需要管理员权限
ArchitecturesAllowed=x64               ; 仅支持64位系统

; -- 多语言支持 --
[Languages]
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

; -- 用户选项配置 --
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "autostart"; Description: "开机自动启动"; GroupDescription: "高级选项:"

; -- 文件配置（关键部分）--
[Files]
; 主程序
Source: "dist\StockMonitor.exe"; DestDir: "{app}"; Flags: ignoreversion

; 资源文件（按需添加）
Source: "assets\*"; DestDir: "{app}\assets"; Flags: recursesubdirs createallsubdirs
Source: "config\*.json"; DestDir: "{app}\config"

; -- 快捷方式配置 --
[Icons]
Name: "{group}\股票监控"; Filename: "{app}\StockMonitor.exe"
Name: "{group}\卸载程序"; Filename: "{uninstallexe}"
Name: "{userdesktop}\股票监控"; Filename: "{app}\StockMonitor.exe"; Tasks: desktopicon

; -- 开机自启动注册表 --
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; 
    ValueType: string; ValueName: "StockMonitor"; 
    ValueData: """{app}\StockMonitor.exe"""; Tasks: autostart

; -- 安装后操作 --
[Run]
Filename: "{app}\StockMonitor.exe"; Description: "运行应用程序"; Flags: postinstall nowait